<!DOCTYPE html>
<!--  Licensed to the .NET Foundation under one or more agreements. -->
<!-- The .NET Foundation licenses this file to you under the MIT license. -->
<html>
  <head>
    <title>WasmSampleApp</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  </head>
  <body>
    <h3 id="header">Wasm Browser Sample</h3>
    <div>Hello <span id="name">wasm <span id="out"></span></span>!<br />Running on mono runtime<br />Using C# </div>
    <br />
    <div id="clickCounter">Hello World!</div>
    <div><button onclick="App.incrementCounter()">Click Me!</button></div>
    <br />
    <div><input id="enterName" placeholder="Your Name"></input></div>
    <div><button onclick="App.greetName()">Enter</button></div>

    <script type='text/javascript'>
      var App = {
        init: function () {
          var ret = BINDING.call_static_method("[WasmSampleApp] WasmSampleApp:TestMeaning", []);
          document.getElementById("out").innerHTML = ret;
          console.log ("ready");
        },
        incrementCounter: function () {
          var count = BINDING.call_static_method("[WasmSampleApp] WasmSampleApp:IncrementCounter", []);
          document.getElementById("clickCounter").innerHTML = count;
        },
        greetName: function () {
          var name = document.getElementById("enterName").value;
          var greet = BINDING.call_static_method("[WasmSampleApp] WasmSampleApp:GreetName", [name]);
          document.getElementById("name").innerHTML = greet;
        }
      };
    </script>
    <script type="text/javascript" src="mono-config.js"></script>
    <script type="text/javascript" src="runtime.js"></script>

    <script defer src="dotnet.js"></script>

  </body>
</html>